<md-dialog aria-label="Login" class="amf-login-dialog">

    <form name="loginForm" data-ng-submit="dialog.handleSubmit()" novalidate>

		<div class="amf-login-dialog-header">
			<md-icon md-svg-icon="account-circle" class="md-accent "></md-icon>
			<h2 md-colors="{color: 'primary'}">Login</h2>
		</div>
        <md-dialog-content class="md-dialog-content" role="document" tabIndex="-1" layout="column">
                <md-input-container >
                    <label>Username:</label>
                    <input name="username" ng-model="dialog.username" required md-autofocus>
                </md-input-container>

                <md-input-container md-is-error="(loginForm.password.$error && loginForm.password.$touched) || dialog.error">
                    <label>Password:</label>
                    <input name="password" ng-model="dialog.password" type="password" required>
					<div ng-messages="dialog.error">
						<div ng-message="unauthorized">{{dialog.error.unauthorized}}</div>
					</div>
                </md-input-container>
		</md-dialog-content>

        <md-dialog-actions layout="row">
            <span flex></span>
            <md-button type="submit" class="md-primary md-confirm-button" aria-label="login">
                Login
            </md-button>
        </md-dialog-actions>

    </form>

</md-dialog>
